#!/bin/bash
python ./weblaunchmany.py 8080 &
pid="$!"
#trap ctrl+c
trap leave INT
leave() {
    echo `kill -9 $pid`
    cd /home/general/Downloads
##    rm -rf \[DB\]_Naruto_Shippuuden_044_\[3BEF93DD\].avi 
##    rm -rf ./Star\ Trek\ DS9\ -\ Season\ 5\ \[NiteShdw\ 170mb\]/
    exit 0
}
sleep 2
echo "File One"
curl 'http://localhost:8080/torrent_file/?torrent=%2Fhome%2Fgeneral%2Fcode%2Fweblaunchmany%2Fns044.torrent&save_path=%2Fhome%2Fgeneral%2FDownloads'
##echo
##echo "File Two"
##curl 'http://localhost:8080/torrent_file/?torrent=%2Fhome%2Fgeneral%2Fcode%2Fweblaunchmany%2FStar+Trek+DS9+-+Season+5+%5BNiteShdw+170mb%5D.torrent+-moNova.org-+.torrent&save_path=%2Fhome%2Fgeneral%2FDownloads'
echo;echo;
sleep 2
curl http://localhost:8080/start
sleep 5
while [ true ] ; do
##    echo "pid=$pid";
    sleep 5;
done
